import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'colors.dart';

class TextStyles {
  static TextStyle textStyle(Color color, double size, {FontWeight fontWeight = FontWeight.w400}) {
    return TextStyle(color: color, fontSize: size, fontWeight: fontWeight);
  }

  static TextStyle default33TextStyle() {
    return TextStyle(
      decoration: TextDecoration.none,
      color: ColorStyle.color_333333,
      fontSize: 16.sp,
    );
  }

  static TextStyle default81TextStyle() {
    return TextStyle(
      decoration: TextDecoration.none,
      color: Color(0xff818181),
      fontSize: 14.sp,
    );
  }

  static TextStyle white16TextStyle() {
    return TextStyle(
      color: Colors.white,
      fontSize: 16.sp,
    );
  }

  static TextStyle whiteTextStyle(double fontSize) {
    return TextStyle(
      color: Colors.white,
      fontSize: fontSize,
    );
  }

  static TextStyle gray9714TextStyle() {
    return TextStyle(
      color: Color(0xff979797),
      fontSize: 14.sp,
    );
  }

  static TextStyle black16TextStyle() {
    return TextStyle(
      color: Colors.black,
      fontSize: 16.sp,
    );
  }

  static TextStyle gray8112TextStyle() {
    return TextStyle(
      color: const Color(0xff818181),
      fontSize: 12.sp,
    );
  }

  static TextStyle styleWithColorAndFontSize(Color color, double size) {
    return TextStyle(
      color: color,
      fontSize: size,
    );
  }

  static TextStyle gray81TextStyleWithSize(double size) {
    return TextStyle(
      color: const Color(0xff818181),
      fontSize: size,
    );
  }

  static TextStyle font12TextStyleWithColor(Color color) {
    return TextStyle(
      color: color,
      fontSize: 12.sp,
    );
  }

  static TextStyle medium86TextStyleWithSize(double size) {
    return TextStyle(color: const Color(0xff868686), fontSize: size, fontWeight: FontWeight.w500);
  }

  static TextStyle mediumSize16TextStyleWithColor(Color color) {
    return TextStyle(color: color, fontSize: 16.sp, fontWeight: FontWeight.w500);
  }

  static TextStyle mediumSizeTextStyleWithColorAndSize(Color color, double size) {
    return TextStyle(color: color, fontSize: size, fontWeight: FontWeight.w600);
  }

  static BoxDecoration white20CornerDecoration() {
    return BoxDecoration(
      color: Colors.white,
      borderRadius: BorderRadius.circular(20),
    );
  }

  static BoxDecoration borderDecorationWithColorAndRadius(Color color, double radius) {
    return BoxDecoration(
      borderRadius: BorderRadius.circular(radius),
      border: Border.all(
        color: color,
        width: 1.0,
      ),
    );
  }

  static EdgeInsetsGeometry edgeSpace16LeftAndRight() {
    return EdgeInsets.only(left: 16.w, right: 16.w);
  }

  static EdgeInsetsGeometry edgeContentLeftAndRight() {
    return EdgeInsets.only(left: 20.w, right: 20.w);
  }

  static Widget lineView() {
    return Container(
      height: 1.h,
      color: const Color(0xfff7f7f7),
    );
  }

  static Widget lineView_w20() {
    return Container(
      height: 1,
      padding: EdgeInsets.only(left: 20.w, right: 20.w),
      child: Container(
        color: const Color(0xfff7f7f7),
      ),
    );
  }

  static Widget dividerPadding36 = Divider(
    height: 1.w,
    indent: 36,
    endIndent: 36,
    color: const Color(0xfff7f7f7),
  );

  ///borderType 0无圆角 1上圆角 2下圆角
  static BorderRadius rowCornerRadius(int type) {
    if (type == 0) {
      return BorderRadius.zero;
    } else if (type == 1) {
      return BorderRadius.only(topLeft: Radius.circular(20.w), topRight: Radius.circular(20.w));
    } else if (type == 2) {
      return BorderRadius.only(bottomLeft: Radius.circular(20.w), bottomRight: Radius.circular(20.w));
    } else {
      return BorderRadius.all(Radius.circular(20.w));
    }
  }

  static BoxDecoration white20Corner() {
    return BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(20.w)));
  }
}
